﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ucb.Workshop.WinApp.View.GestionProveedor;
using Ucb.Workshop.WinApp.View.GestionProducto;
using Ucb.Workshop.WinApp.View.GestionUsuario;

namespace Ucb.Workshop.WinApp
{
    public partial class Form1 : Form
    {
        ProveedorOpc provOpc;//1
        ProductoOpc prodOpc;//2
        UsuarioOpc usuaOpc;//3
        //Prueba marcaOpc;//4

        int opc = 0;
        public Form1()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            this.cambiarOpcion();
            opc = 2;
            prodOpc = new ProductoOpc();
            prodOpc.Location = new System.Drawing.Point(150, 10);
            this.Controls.Add(prodOpc);
        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripButton1_Click_1(object sender, EventArgs e)
        {
            this.cambiarOpcion();
            opc = 1;
            // Evento de creacion del control de Proveedor
            provOpc = new ProveedorOpc();
            provOpc.Location = new System.Drawing.Point(150, 10);
            this.Controls.Add(provOpc);
        }

        public void cambiarOpcion()
        {
            switch (opc)
            {
                case 1:
                    this.Controls.Remove(provOpc);
                    break;
                case 2:
                    this.Controls.Remove(prodOpc);
                    break;
                case 3:
                    this.Controls.Remove(usuaOpc);
                    break;
                //case 4:
                //    this.Controls.Remove(marcaOpc);
                //    break;
             
            }


        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            this.cambiarOpcion();
            opc = 3;
            usuaOpc = new UsuarioOpc();
            usuaOpc.Location = new System.Drawing.Point(150, 10);
            this.Controls.Add(usuaOpc);
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            this.cambiarOpcion();
            opc = 4;
            //marcaOpc = new prueba();
           // marcaOpc.Location = new System.Drawing.Point(150, 10);
            //this.Controls.Add(marcaOpc);
            //marcaOpc.Show();
           
        }



    }
}
